/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tuan02;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 *
 * @author XuanHung
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws FileNotFoundException, IOException {
        // TODO code application logic here
        BaiTap01();
        BaiTap02();
        BaiTap03();
        BaiTap04();
    }
    
    public static void BaiTap01() throws FileNotFoundException{
        String str;
        Scanner sn = new Scanner(System.in);
        System.out.println("Nhap chuoi can ghi ra File");
        str = sn.next();
        FileOutputStream fos = new FileOutputStream("dulieu.txt", true);
        PrintWriter fw = new PrintWriter(fos);
        fw.println(str);
    }
    public static void BaiTap02() throws FileNotFoundException, IOException{
        clsPhanSo.DocPhanSo();
    }
    public static void BaiTap03() throws FileNotFoundException, IOException{
        clsBT3 bt = new clsBT3();
        System.out.println("Nhap So Luong So nguyen cua mang");
        Scanner  sn = new Scanner(System.in);        
        bt.PhatSinhSONguyen(sn.nextInt());
        bt.GhiFile();
        bt.DocFile();
        
    }    
    public static void BaiTap04() throws FileNotFoundException, IOException{
        Scanner sn = new Scanner(System.in);
        System.out.println("Nhap So luong hoc sinh");        
        int n = sn.nextInt();
        clsHocSinh.NhapHocSinh(n);
        clsHocSinh.DocHocSinhvaXuat();
    }
}
